<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>对象字面量</title>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <input type="text" name="" v-demo="{name:'张三', age:'23'}" value="" v-model="name">
    </div>

    <script>
        Vue.directive('demo', {
            bind: function(el, binding) {
                console.log('参数姓名：' + binding.value.name);
                console.log('参数年龄：' + binding.value.age);
            }
        })

        new Vue({
            el: '#app',
            data: {
                name: ''
            }
        })
    </script>
</body>

</html>
